﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Kinect;

namespace Brain.Kinect
{
    public static class KinectUtil
    {
        /// <summary>
        /// This method is used to map the SkeletonPoint to the color frame.
        /// </summary>
        /// <param name="point">The SkeletonPoint to map.</param>
        /// <returns>A Vector2 of the location on the color frame.</returns>
        public static Vector2 SkeletonToColorMap(SkeletonPoint point, KinectSensor sensor)
        {
            // This is used to map a skeleton point to the color image location
            ColorImagePoint colorPt = sensor.MapSkeletonPointToColor(point, sensor.ColorStream.Format);
            return new Vector2(colorPt.X, colorPt.Y);
        }
    }
}
